using System;
using System.Collections.Generic;
using ScrumManagementTool.db;
using ScrumManagementTool.db.interfaces;
using ScrumManagementTool.domain;
using ScrumManagementTool.domain.interfaces;
using ScrumManagementTool.service.interfaces;

namespace ScrumManagementTool.service
{
    public class ProjectService : IProjectService
    {
        private IDbProject dbProject;

        public ProjectService():this(new DbProject())
        {
            
        }

        public ProjectService(IDbProject dbProject)
        {
            this.dbProject = dbProject;    
        }

        public IProject CreateNewProject(string name)
        {
            IProject project = new Project {Name = name};

            dbProject.AddNewProject(name);

            return project;
        }

        public IList<string> GetAllProjectNames()
        {
            return dbProject.GetAllProjectNames();
        }
    }
}